package String.StringDemo;

import java.util.Scanner;

public class 字符数量统计 {
    public static void main(String[] args) {
        // 键盘录入一个字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String s = sc.next();
        // 统计大写字母 小写字母 数字的个数
        int bigCount = 0;
        int smallCount = 0;
        int Count = 0;

        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c >= 'a' && c <= 'z') {
                smallCount++;
            } else if (c >= 'A' && c <= 'Z') {
                bigCount++;
            } else if (c >= '0' && c <= '9') {
                Count++;
            }
        }
        System.out.println("大写字母的个数："+bigCount);
        System.out.println("小写字母的个数："+smallCount);
        System.out.println("数字的个数："+Count);

    }
}
